/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.wadministration;

import com.opensymphony.xwork2.ActionSupport;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author Trang
 */
public class DisplayFDF extends ActionSupport{
    private InputStream fileStream;

    public InputStream getFileStream() {
        return fileStream;
    }

    public void setFileStream(InputStream fileStream) {
        this.fileStream = fileStream;
    }
//    params = {"namespace", "/tutorials", "actionName", "getTutorialPage", "message", "${bestTutorialSite}"}
     @Action(value = "pdf", results = {
//        @Result(name = "success", type = "stream", params = {"inputStream"})
    })
	public String preview() throws Exception {
		try{
			fileStream = new DataInputStream(
			  new FileInputStream("e:/hello_mirrored_margins.pdf"));
		} catch (IOException ioEx) {
			ioEx.printStackTrace();
		}
		return SUCCESS;
	}
}
